<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@3.3.7/dist/css/bootstrap.min.css"
          integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
    <title>Leo-Framework</title>
    <link rel="shortcut icon" href="favicon.ico"  type="image/x-icon"/>
</head>
<style>
    .item {
        width: 100px;
        height: 100px;
        float: left;
        text-align: center;
        line-height: 100px;
    }
</style>
<body>
<div id="data-head">
    <div style="text-align: center">
        <h1>Colorful!☺</h1>
    </div>
</div>
<div id="data-list">
    <div class="item">
        #444555
    </div>
</div>
</body>
<!--使用CDN-->
<script type="text/javascript" src="http://dev.acyou.cn/resources/js/jquery-3.7.1.min.js"></script>
<!--使用本地-->
<!--<script src="js/jquery-1.4.4.min.js"></script>-->
<script>
    (function () {
        $.ajax({
            cache: true,
            type: "get",
            dataType: "json",
            url: "sys/common/color?count=150&hasAlpla=true",
            data: null,
            async: true,
            success: function (res) {
                console.log(res)
                $("#data-list").empty();
                res.data.forEach(x => {
                    var template = "        <div class=\"item\" style='background: " + x.hexColor + "'>\n" +
                        "            " + x.hexColor + "\n" +
                        "        </div>";
                    $("#data-list").append(template);
                })
            },
            error: function (res) {
                console.error(res)
            }
        });
    })();
</script>
</html>